/**
 * @version Create on 2012-11-13
 * @author Yinzi Chen
 */

public class MultiplyStrings {

	public String multiply(String num1, String num2) {
		int n = num1.length(), m = num2.length();
		int[] a = new int[n];
		int[] b = new int[m];
		int[] res = new int[n + m + 1];
		for (int i = 0; i < n; ++i) {
			a[i] = num1.charAt(n - i - 1) - '0';
		}
		for (int i = 0; i < m; ++i) {
			b[i] = num2.charAt(m - i - 1) - '0';
		}
		for (int i = 0; i < n; ++i)
			for (int j = 0; j < m; ++j) {
				res[i + j] += a[i] * b[j];
			}
		for (int i = 0; i < m + n; ++i) {
			res[i + 1] += res[i] / 10;
			res[i] %= 10;
		}
		int i = m + n;
		while (i > 0 && res[i] == 0)
			i--;
		String num3 = "";
		while (i >= 0)
			num3 += (char) (res[i--] + '0');
		return num3;
	}

	public static void main(String[] args) {
		MultiplyStrings a = new MultiplyStrings();
		System.out.println(a.multiply("99", "99"));
	}

}
